package com.d0315;

import java.util.Scanner;

public class Rect extends Shape {
    @Override
    double area() {
        return length*widght;
    }
    @Override
    double perimeter() {
        return (length+widght)*2;
    }

    public static void main(String[] args) {
        Rect rectangle = new Rect();
        System.out.println("请输入矩形的长和宽：");
        Scanner input = new Scanner(System.in);
        length = input.nextInt();
        widght = input.nextInt();
        System.out.println("周长："+rectangle.perimeter());
        System.out.println("面积："+rectangle.area());
    }

}
